﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/SBOKProtal.Master"
    Inherits="System.Web.Mvc.ViewPage<Microhard.Protal.Models.CategoryModel>" %>

<%@ Import Namespace="Microhard.WebUI.Protal.Extensions" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <%=Model.Name %>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="etb-7 clean cleaner">
        <div class="float-box w6">
            <div class="m">
                <h3>
                    <%=Model.Description %></h3>
                <div class="content">
                    <%=Model.DescriptionContent %></div>
            </div>
        </div>
        <div class="float-box w6">
            <div class="mt mb">
                <div class="scroll-lr clean">
                    <div class="left" style="opacity: 0.25;">
                        <div>
                        </div>
                    </div>
                    <div class="clip">
                        <div class="content" style="width: 1200px;">
                            <div class="block">
                                <%
                                    var rightImage = Html.GetFile("右侧小图", Model.CategoryID);
                                    if (rightImage != null)
                                    {
                                        string base64String = Convert.ToBase64String(rightImage.Content);
                
                                %>
                                <img width="400" height="300" title="<%=Model.Description %>" alt="<%=Model.Description %>"
                                    src="<%=String.Format("data:image/png;base64,{0}",base64String)%>">
                                <%} %>
                            </div>
                        </div>
                    </div>
                    <div class="right">
                        <div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="m wrapper clean">
        <div class="ml mb mt clean">
            <div class="float-box-right clean mb mt">
            </div>
            <h2 class="ml mt float-box">
                产品</h2>
        </div>
        <div class="table-tab-group">
            <div class="items clean">
                <div class="border-left">
                    <div class="border-right">
                        <div class="viewport" style="height: 240px;">
                            <div class="workspace clean" style="left: -225px; width: 1125px; height: 240px;">
                                <%
                                    var prds = Model.Products;
                                    if (prds == null || prds.Count == 0)
                                    {                                     
                                %>
                                暂无产品
                                <%}
                                    else
                                    {
                                        foreach (var p in prds)
                                        {
                                            var prdImg = Html.GetFile("产品简图", p.ProductID);
                                            string base64String = string.Empty;
                                            if (prdImg != null && prdImg.Content != null)
                                            {
                                                base64String = Convert.ToBase64String(prdImg.Content);
                                            }
                                %>
                                <div class="float-box item" style="height: 215px;">
                                    <div class="image">
                                        <img title="<%=p.Name %>" alt="<%=p.Name %>" src="<%=String.Format("data:image/png;base64,{0}",base64String)%>"
                                            ></div>
                                    <div class="content-wrap">
                                        <div class="text">
                                            <%=p.Name %>
                                        </div>
                                        <div class="highlight-arrow">
                                            <span><a title="<%=p.Name %>" href="<%=Url.Action("Product", "Home", new { prdID = p.ProductID})%>">
                                                打开本产品的详细信息</a></span>
                                        </div>
                                    </div>
                                </div>
                                <%}
                                    }%>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="CPHHeaderImage" runat="server">
    <div class="headimage">
        <%
            var headerImage = Html.GetFile("背景图", Model.CategoryID);
            if (headerImage != null)
            {
                string base64String = Convert.ToBase64String(headerImage.Content);
                
        %>
        <div style='background: url(<%=String.Format("data:image/png;base64,{0}",base64String)%>) no-repeat top;
            height: 540px;'>
        </div>
        <%} %>
    </div>
</asp:Content>
